package com.homelock.common.enums.sms;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author chenmf@tuya.com
 * @date 2020年07月15日02:43:00
 */
@Getter
@AllArgsConstructor
public enum ZxSmsTemplateEnum {
    /**
     * 试开报警
     */
    ALARM_UNLOCK_RETRY(SmsSendTypeEnum.ALARM_UNLOCK_RETRY, "SMS_193248840"),
    /**
     * 撬锁报警
     */
    ALARM_LOCK_PICK(SmsSendTypeEnum.ALARM_LOCK_PICK, "SMS_193233937"),
    /**
     * 低电告警
     */
    ALARM_LOW_BATTERY(SmsSendTypeEnum.ALARM_LOW_BATTERY, "SMS_193243993"),
    /**
     * 劫持
     */
    ALARM_HIJACK(SmsSendTypeEnum.ALARM_HIJACK, "SMS_193243999"),
    /**
     * 指纹报警
     */
    ALARM_FINGER(SmsSendTypeEnum.ALARM_FINGER, "SMS_193233945"),
    /**
     * 普通开门记录
     */
    UNLOCK_RECORD(SmsSendTypeEnum.UNLOCK_RECORD, "SMS_193248849"),

    ;
    /**
     * 消息类型
     */
    private SmsSendTypeEnum smsSendTypeEnum;
    /**
     * 消息类型对应的短信模板编号
     */
    private String template;

    public static String getBySmsSendType(SmsSendTypeEnum smsSendTypeEnum) {
        if (null != smsSendTypeEnum) {
            for (ZxSmsTemplateEnum zxSmsTemplateEnum : values()) {
                if (zxSmsTemplateEnum.getSmsSendTypeEnum() == smsSendTypeEnum) {
                    return zxSmsTemplateEnum.getTemplate();
                }
            }
        }
        return null;
    }
}
